package subraSoft.centaurus.gui.components;

import java.awt.Component;

import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;

import subraSoft.centaurus.model.cobj.CenDefaultCObj;

public abstract class CenCObjCellRenderer extends JLabel implements ListCellRenderer {

	@Override
	public Component getListCellRendererComponent(JList list, Object value,
			int index, boolean isSelected, boolean cellHasFocus) {
		
		setText( getLabel((CenDefaultCObj)value) );
		
		return this;
	}

	protected abstract String getLabel(CenDefaultCObj value);

}
